package com.example.springdata.lambda;

import sun.awt.image.ImageWatched;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class TestCollector {
    private static void insertFirst(List<Integer> l,String type){
        int total=1000*1000;
        final int number=5;
        long start=System.currentTimeMillis();
        for(int i=0;i<total;i++){
            l.add(i);
        }
        long end=System.currentTimeMillis();
        System.out.println(type+"前插入"+total+"条数据，花费时间:"+(end-start));
    }

    public static void main(String[] args) {
        List<Integer> l;
        l=new ArrayList<Integer>();
        insertFirst(l,"ArrayList");
        l=new LinkedList<>();
        insertFirst(l,"LinkedList");
    }
}
